<%@page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="x" uri="/soar-bx-tags"%>
<x:HeaderParts/>
<x:MainPartsTag>
<x:zone name="MainZone">
<x:Form action="auth/appmenu.shtml">
<x:ParamsParts>
<x:TextField name="id" type="hidden" />
<x:TextField name="muDisplay" type="hidden" />
</x:ParamsParts>
<x:TabParts activeIndex="0" tabs="[菜单管理:'']" ></x:TabParts>
<x:SearchParts>
名称：<x:TextField name="searchMuName" title="名称"/>
终端：
<select name="searchMuPlatform">
	<option value="">请选择</option>
	<option value="1" <s:if test="searchMuPlatform==1">selected="selected"</s:if>><i class="fa fa-windows"></i>PC</option>
	<option value="2" <s:if test="searchMuPlatform==2">selected="selected"</s:if>><i class="fa fa-mobile"></i>移动</option>
</select>
</x:SearchParts>
<x:Table checkBoxName="cids" rootNodeValue="000000000000000000" keyFieldName="ID" parentFieldName="PID" tree="true" showLevel="4" showIndex="false">
<x:Column value="MU_NAME" label="名称" isTreeCol="true" style="width:20%;"></x:Column>
<x:Column label="图标" style="width:50px;" escape="false" align="center">
<i class="{MU_ICON} fa-2x"></i>
</x:Column>
<x:Column value="MODE_CODE" label="编码" style="width:200px;"></x:Column>
<x:Column value="MU_URL" label="链接" style="width:20%;" maxLength="30" title="{MU_URL}"></x:Column>
<x:Column label="终端" checks="1:PC,2:移动" style="width:50px;" align="center" iif="true">
<x:If test="MU_PLATFORM==1"><i class="fa fa-windows fa-2x"></i></x:If>
<x:If test="MU_PLATFORM==2"><i class="fa fa-mobile fa-2x"></i></x:If>
</x:Column>
<x:Column value="UPDATE_DATE" label="更新时间" style="width:200px;" formatDateTime="true" align="center"></x:Column>
<x:Column escape="false" label="排序" style="width:100px;" align="center">
<input type="hidden" value="{ID}" name="ids">
<input type="text" value="{MU_ORDER}" name="orders" onblur="checknum(this.value)" dataType="IntVal" style="width: 100%;height: 100%;">
</x:Column>
<x:Column value="MU_DISPLAY" label="显示标志"  checks="0:显示,1:隐藏,9:禁用" style="width:100px;" align="center" iif="true" escape="false">
<x:If test="MU_DISPLAY == 0"><a href="javascript:void(0);" onclick="changeStatus('{ID}',1)">收起</a></x:If>
<x:If test="MU_DISPLAY == 1"><a href="javascript:void(0);" onclick="changeStatus('{ID}',0)">展开</a></x:If>
<x:If test="MU_DISPLAY == 9"><a href="javascript:void(0);" onclick="changeStatus('{ID}',1)">禁用</a></x:If>
</x:Column>
<x:Column escape="false" label="操作"  style="width:200px;" align="center" iif="true">
<x:If test="MU_LEVEL < 3">
<x:Button role="primary" size="xs" value="新增" onclick="X.Modal('auth/appmenu!doNew.shtml?pid={ID}&&muLevel={MU_LEVEL}&&muPlatform={MU_PLATFORM}','','','1000px','355px','添加菜单')"></x:Button>
</x:If>
<x:If test="MU_LEVEL == 3">
<x:Button role="primary" size="xs" value="新增" onclick="X.Modal('auth/appmenu!doNew.shtml?pid={ID}&&muLevel={MU_LEVEL}&&muPlatform={MU_PLATFORM}','','','500px','240px','权限点')"></x:Button>
</x:If>
<x:If test="MU_LEVEL < 4">
<x:Button role="warning" size="xs" value="编辑" onclick="X.Modal('auth/appmenu!doShow.shtml?id={ID}','','','1000px','355px','编辑菜单')"></x:Button>
</x:If>
<x:If test="MU_LEVEL == 4">
<x:Button role="warning" size="xs" value="编辑" onclick="X.Modal('auth/appmenu!doShow.shtml?id={ID}','','','500px','240px','编辑菜单')"></x:Button>
</x:If>
<x:If test="1 == 1">
<x:Button role="danger" size="xs" value="删除" onclick="dodelete('{ID}')"></x:Button>
</x:If>
</x:Column>
</x:Table>
<x:ButtonsParts>
<x:Button role="primary" value="新增" onclick="X.Modal('auth/appmenu!doNew.shtml','','','1000px','390px','新增菜单')"></x:Button>
<x:Button role="success" value="保存" onclick="updateorder()"></x:Button>
<x:Button role="danger" value="删除" onclick="deletePl()"></x:Button>
<x:Button role="default" value="显示" onclick="changeStatusPl(1)"></x:Button>
<x:Button role="default" value="隐藏" onclick="changeStatusPl(0)"></x:Button>
</x:ButtonsParts>
<x:JsParts fn="dodelete,updateorder,checknum,changeStatusPl,changeStatus,deletePl">
function deletePl()
{
	if(X.ChkSlt('cids'))
	{
		X.Alert('删除时会连同子集一起删除，确认删除？',"X.Submit('doDelete')");
	}
}
function changeStatus(id,s)
{
	$("#id").val(id);
	$("#muDisplay").val(s);
	X.Alert("确认修改？","X.Submit('doUpdateStatus')");
}
function changeStatusPl(s)
{
	$("#muDisplay").val(s);
	if(X.ChkSlt("cids"))
	{
		X.Submit("doUpdateStatus");
	}
}
function updateorder()
{
	X.Alert('确定保存？',"X.Submit('saveOrder')");
}
function checknum(v)
{
	if(isNaN(v))
	{
		X.Alert('请填写数字');
	}
}
function dodelete(id)
{
	$("#id").val(id);
	X.Alert('删除时会连同子集一起删除，确认删除？',"X.Submit('doDelete')");
}
</x:JsParts>
</x:Form>
</x:zone>
</x:MainPartsTag>
